# wget https://gitee.com/xiejinglin/env-init/raw/master/apollo/apollo.sh && sh apollo.sh test
#!/bin/bash
if [ ! -d "/opt/settings" ]; then
  echo "/opt/settings不存在，创建路径"
  mkdir /opt/settings
fi

if [ ! -d "/opt/settings/server.properties" ]; then
  echo "server.properties文件不存在，创建路径"

  if [ $1 = test ]; then
      wget -O /opt/settings/server.properties https://gitee.com/xiejinglin/env-init/raw/master/apollo/server-test.properties
  else
      wget -O /opt/settings/server.properties https://gitee.com/xiejinglin/env-init/raw/master/apollo/server-prod.properties
  fi
fi

rm -f apollo.sh